<template>
  <div>

    <el-tabs v-model="active">
      <el-tab-pane label="组件属性" name="first">

        <el-row type="flex" align="middle">
          <el-col :span="6">
            <div class="prop-set-title">
              字段标识
            </div>
          </el-col>
          <el-col :span="18">
            <select-model :model.sync="store.current.model" ></select-model>
          </el-col>
        </el-row>

      </el-tab-pane>
      <el-tab-pane label="表单属性" name="second">
        <form-config   :store='store'></form-config>
      </el-tab-pane>
    </el-tabs>
    

  </div>
</template>

<script>
 import formConfig from "@/low-code/setting/form-config/index.vue"
  import clone from 'clone'
  export default {
    inject: ['getStore'],
    components: { formConfig },
    data () {
      return {
        active: 'first',
      }
    },
    watch: {
      "store.current.options": {
        handler () { //特别注意，不能用箭头函数，箭头函数，this指向全局
          this.$handleStack.push(clone(this.store.root))
        },
        // immediate: true,  //刷新加载 立马触发一次handler
        deep: true  // 可以深度检测到 obj 对象的属性值的变化
      }
    },
    computed: {
      store () {
        return this.getStore()
      }
    }

  }
</script>

<style  scoped>
::v-deep .el-tabs__item[aria-controls] {
  width: 50% !important;
  text-align: center;
}
</style>